Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in Displaying image in Mozilla

Problem in Displaying image in Mozilla

Scheduled Pinned Locked Moved ASP.NET
htmlsysadmintoolshelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    N a r e s h P a t e l
    wrote on last edited by
    #1

    Hi, I am displaying image in html image control without runat=server. The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.

    Naresh Patel

    N 1 Reply Last reply
    0
    • N N a r e s h P a t e l

      Hi, I am displaying image in html image control without runat=server. The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.

      Naresh Patel

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      N a r e s h P a t e l wrote:

      The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.

      So what we can do without seeing a sample code:doh: ? Is your image tag refers from root like /images/imagename.gif or it refers like ~/images/image.gif ? If your image tag is not runat server then you can remove ~ ( if you are using ).


      My Website | Ask smart questions

      N 1 Reply Last reply
      0
      • N N a v a n e e t h

        N a r e s h P a t e l wrote:

        The image src is set runtime by some condition, I am using server script for setting image src. This works fine in IE. But it it does not displaying image into Mozilla. I have dibugged the code the function for setting the Image src had called.

        So what we can do without seeing a sample code:doh: ? Is your image tag refers from root like /images/imagename.gif or it refers like ~/images/image.gif ? If your image tag is not runat server then you can remove ~ ( if you are using ).


        My Website | Ask smart questions

        N Offline
        N Offline
        N a r e s h P a t e l
        wrote on last edited by
        #3

        string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like ![](<%# SetImage(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,)" />

        Naresh Patel

        N G 2 Replies Last reply
        0
        • N N a r e s h P a t e l

          string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like ![](<%# SetImage(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,)" />

          Naresh Patel

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          N a r e s h P a t e l wrote:

          _ReturnUrl = Server.MapPath("../images/button-green.gif");

          To show image in browser, no need of Server.MapPath(). This gives exact location to the image. We need only virtual path. So try removing Server.MapPath


          My Website | Ask smart questions

          1 Reply Last reply
          0
          • N N a r e s h P a t e l

            string _ReturnUrl; public string SetImage1(bool _Active) { if (_Active) { _ReturnUrl = Server.MapPath("../images/button-green.gif"); } else { _ReturnUrl = Server.MapPath("../images/button-red.gif"); } return _ReturnUrl; } and accesing in grid view Like ![](<%# SetImage(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,)" />

            Naresh Patel

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Server.MapPath gives you the physical address of the file on the server. That is useless to the browser, and the only reason that it may work at all is if you are browsing on the same computer that is acting as a server. Just remove Server.MapPath.

            --- single minded; short sighted; long gone;

            N 1 Reply Last reply
            0
            • G Guffa

              Server.MapPath gives you the physical address of the file on the server. That is useless to the browser, and the only reason that it may work at all is if you are browsing on the same computer that is acting as a server. Just remove Server.MapPath.

              --- single minded; short sighted; long gone;

              N Offline
              N Offline
              N a r e s h P a t e l
              wrote on last edited by
              #6

              Thanks yaar for helping: I got solution: ![](../images/button-<%# SetImage(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,)" />

              Naresh Patel

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups